<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/header::header-fragment"></head>
<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper">

    <!-- 引入页面头header-nav -->
    <div th:replace="admin/header::header-nav"></div>
    <!-- 引入工具栏sidebar-fragment -->
    <div th:replace="admin/siderbar::sidebar-fragment('index')"></div>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0 text-dark">首页</h1>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- Small boxes (Stat box) -->
        <div class="row">
          <div class="offset-lg-2 col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-info" id="commentsBox" url="/admin/commentManager" onclick="clickBox(this)">
              <div class="inner">
                <h3 th:text="${TotalComments}"></h3>
                <p>评论数</p>
              </div>
              <div class="icon">
                <i class="fas fa-comments"></i>
              </div>             
            </div>
          </div>
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-warning" id="blogsBox" url="/admin/manager" onclick="clickBox(this)">
              <div class="inner">
                <h3 th:text="${TotalBlogs}"></h3>
                <p>博客数</p>
              </div>
              <div class="icon">
                <i class="fas fa-book-open"></i>
              </div>
            </div>
          </div>
          <!-- ./col -->
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-danger" id="viewsBox" url="/admin/historicalViews" onclick="clickBox(this)">
              <div class="inner">
                <h3 th:text="${TotalViews}"></h3>
                <p>访问量</p>
              </div>
              <div class="icon">
                <i class="fas fa-users"></i>
              </div>            
            </div>
          </div>
          <!-- ./col -->
        </div>
        <!-- /.row -->
      </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
  </div>
    <!-- 引入页脚footer-fragment -->
    <div th:replace="admin/footer::footer-fragment"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script th:src="@{/admin/dist/js/jquery.min.js}"></script>
<!-- Bootstrap 4 -->
<script th:src="@{/admin/dist/js/bootstrap.bundle.min.js}" ></script>
<!-- FastClick -->
<script th:src="@{/admin/dist/js/fastclick.js}" ></script>
<!-- AdminLTE App -->
<script th:src="@{/admin/dist/js/adminlte.min.js}"></script>
<script>
  function clickBox(obj) {
    var url = obj.getAttribute("url");
    console.log(url);
    location.href=url;
  }
</script>
</body>
</html>
